<?php
include 'appinclude.php';
include 'schedule.inc.php';

// establish link with mysql database
$link = @mysql_connect($GLOBALS["db_host"], $GLOBALS["db_user"], $GLOBALS["db_pass"]);
@mysql_select_db($GLOBALS["db_name"]);

// look for users without any classes
$cal_res = mysql_query('SELECT cal_strings.uid, cal_strings.cal_string FROM cal_strings LEFT JOIN Student_Class ON cal_strings.uid = Student_Class.uid WHERE Student_Class.uid IS NULL');
while($row = mysql_fetch_array($cal_res, MYSQL_NUM))
{
	$url = stripslashes('http://scheduleman.org/schedules/'.$row[1]);
	if(!test_valid_ics($url))
	 continue;
  
  parseAddClasses($row[0], $url);
}

?>